#include <iostream>
#include <cmath>
#include <string>
#include <iomanip>
using namespace std;
// 复数乘法
int main(){
    double r1, p1, r2, p2, A, B;
    cin >> r1 >> p1 >> r2 >> p2;
    A = (r1*r2) * cos(p1 + p2);
    B = (r1*r2) * sin(p1 + p2);
    if(fabs(A) < 0.01){
        A = 0;
    }
    if(fabs(B) < 0.01){
        B = 0; 
    }
    
        if(B >= 0){
            cout << setiosflags(ios::fixed) << setprecision(2) << A << "+" << B << "i";
        }else {
            cout << setiosflags(ios::fixed) << setprecision(2) << A << "-" << fabs(B) << "i";
        }
    
    

    return 0;
}

